package com.hspedu.List_;
/*
 *@auther will
 *@version 1.0
 */

import java.util.ArrayList;
import java.util.List;

public class ListMethod {
    public static void main(String[] args) {
        List list = new ArrayList();
        list.add("张三丰");
        list.add("贾宝玉");
        list.add(1,"王宝才");
        System.out.println(list);
        list.set(1,"林黛玉");
        System.out.println(list);
        List list1 = list.subList(0, 2);
        System.out.println(list1);
    }
}
